#!/bin/sh

>tmp$$
cat CompositeStocks |sort |uniq |while read stock
do

export _powerrating=`curl -stderr -b "CFGLOBALS=HITCOUNT%3D6%23LASTVISIT%3D%7Bts+%272007%2D01%2D31+22%3A49%3A19%27%7D%23TIMECREATED%3D%7Bts+%272006%2D10%2D14+00%3A08%3A00%27%7D%23; __utma=37317605.857987777.1160798888.1160800866.1170301752.3; CFID=31721102; CFMAGIC=31721102%3A81490065; CFTOKEN=81490065; __utmz=37317605.1160798888.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); SESSIONID=01311058; VIEWED=000; __utmb=37317605; __utmc=37317605; SOURCE=URL%5Ftradingmarkets" -d "symbol=$stock" http://www.tradingmarkets.com/.site/powerratings |egrep -o "[0-9].swf" |head -n 1 | cut -d'.' -f1`

echo $stock $_powerrating >> tmp$$

done

cat tmp$$ |awk '{print $2" "$1}'|egrep -w "[6|7|8|9]" |sort -n -r |head -n 100|awk '{print $2}' > PowerLongList
cat tmp$$ |awk '{print $2" "$1}'|egrep -w "[1|2]" |sort -n  |head -n 50|awk '{print $2}' > PowerShortList

